<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../res/vue.js"></script>
    <link rel="stylesheet" href="app.css"></link>
</head>
<body>
<script type="text/javascript">
</script>
<div id="app-1">
    <div>
        <h1>我是父组件标题</h1>
        <my-component>
            <p>初始内容</p>
            <p>初始内容</p>
        </my-component>


    </div>
</div>
</body>
<script type="text/javascript">
    Vue.component('my-component',{
        template:'<div><h2>子组件的标题</h2><slot>只有在没有要分发的内容时才会显示</slot></div>'
    });

    Vue.component();
    var app = new Vue({
        el:'#app-1'
    });

</script>
</html>